/**
 * Created by Administrator on 2016/9/6.
 */
webpackJsonp([2], {
    0: function (e, t, s) {
        "use strict";
        s(1),
            s(11);
        var i = s(32),
            n = s(192)([["/", s(218)]]);
        i.config(n)
    },
    218: function (e, t, s) {
        "use strict";
        s(219);
        var i = s(225);
        angular.module("eleme.page").service("qqmap", s(226)).directive("mapHeader", s(231)).directive("mapMain", s(237)).directive("mapFooter", s(242)).directive("mapSearch", s(246)).directive("mapCity", s(250)),
            e.exports = {
                templateUrl: i,
                controller: ["$rootScope", "$scope",
                    function (e, t) {
                        e.layoutState = {
                            hideSidebar: !0,
                            whiteBody: !0
                        },
                            t.mapMode = !1
                    }]
            }
    },
    219: function (e, t) {
    },
    225: function (e, t) {
        var s = "/entry/home/map/map.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(s, '<div class=map ng-class="{mapmode: mapMode}"><div class="container mapcontainer"><div map-header></div><div map-main map-mode=mapMode></div><div map-footer></div></div></div>')
            }]),
            e.exports = s
    },
    226: function (e, t, s) {
        "use strict";
        function i(e) {
            if (Array.isArray(e)) {
                for (var t = 0,
                         s = Array(e.length); t < e.length; t++) s[t] = e[t];
                return s
            }
            return Array.from(e)
        }

        function n(e, t) {
            if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
        }

        var a = Function.prototype.bind,
            r = function () {
                function e(e, t) {
                    for (var s = 0; s < t.length; s++) {
                        var i = t[s];
                        i.enumerable = i.enumerable || !1,
                            i.configurable = !0,
                        "value" in i && (i.writable = !0),
                            Object.defineProperty(e, i.key, i)
                    }
                }

                return function (t, s, i) {
                    return s && e(t.prototype, s),
                    i && e(t, i),
                        t
                }
            }(),
            o = s(31),
            c = s(227);
        s(228),
            e.exports = ["$q", "$rootScope", "$compile", "$location", "Zero",
                function (e, t, u, h, l) {
                    var p = t.$new(),
                        g = function () {
                            function t() {
                                n(this, t),
                                    this.MAP_DEFAULT_ZOOM = 13,
                                    this.MAP_SPRITES = s(230),
                                    this.SEARCHBAR_HEIGHT = 40,
                                    this.RESULTBAR_WIDTH = 280,
                                    this.resultShow = !1,
                                    this.inited = !1,
                                    this.guessCityPromise = this.guessCity(),
                                    this.comfrom = h.search().com_from,
                                    this.redirect_url = h.search().redirect_url
                            }

                            return r(t, [{
                                key: "setup",
                                value: function (e) {
                                    this.el = e,
                                        this.currentCity = {
                                            name: "北京",
                                            id: 1
                                        };
                                    var t = "qqmap",
                                        s = "https://apis.map.qq.com/api/js?v=2.exp&key=FGBBZ-LXIRQ-EIN5W-G6TB5-SDDI7-U4BQ6";
                                    "http:" === location.protocol && (s = "http://map.qq.com/api/js?v=2.exp&key=FGBBZ-LXIRQ-EIN5W-G6TB5-SDDI7-U4BQ6"),
                                        window[t] = this;
                                    var i = document.createElement("script");
                                    i.type = "text/javascript",
                                        i.src = s + "&callback=" + t + ".init",
                                        document.body.appendChild(i)
                                }
                            },
                                {
                                    key: "init",
                                    value: function () {
                                        var e = this;
                                        this.map = new qq.maps.Map(this.el, {
                                            center: new qq.maps.LatLng(39.916527, 116.397128),
                                            zoom: this.MAP_DEFAULT_ZOOM,
                                            panControl: !1,
                                            mapTypeControl: !1,
                                            zoomControl: !0,
                                            zoomControlOptions: {
                                                position: qq.maps.ControlPosition.LEFT_TOP
                                            }
                                        }),
                                            this.INFOWIN_SIZE = new qq.maps.Size(300, 164),
                                            this.infoWin = new qq.maps.InfoWindow({
                                                map: this.map,
                                                size: this.INFOWIN_SIZE
                                            }),
                                            this.searchService = new qq.maps.SearchService,
                                            this.searchMarkers = [],
                                            this.searchResults = [],
                                            this._bindClickAreaEvent(),
                                            this.guessCityPromise.then(function (t) {
                                                return e.changeCity(t, {
                                                    mapMode: !0
                                                })
                                            }),
                                            this.droppinIcons = {
                                                normal: new qq.maps.MarkerImage(this.MAP_SPRITES, new qq.maps.Size(28, 30), new qq.maps.Point(0, 140), new qq.maps.Point(9, 34)),
                                                dragging: new qq.maps.MarkerImage(this.MAP_SPRITES, new qq.maps.Size(28, 34), new qq.maps.Point(30, 140), new qq.maps.Point(2, 34))
                                            },
                                            this.droppin = new qq.maps.Marker({
                                                map: this.map,
                                                draggable: !0,
                                                icon: this.droppinIcons.normal
                                            }),
                                            qq.maps.event.addListener(this.droppin, "dragging",
                                                function () {
                                                    e.droppin.setIcon(e.droppinIcons.dragging)
                                                }),
                                            qq.maps.event.addListener(this.droppin, "dragend",
                                                function (t) {
                                                    e.droppin.setIcon(e.droppinIcons.normal),
                                                        e._showAreaInfo([t.latLng.lat, t.latLng.lng])
                                                }),
                                            this.inited = !0
                                    }
                                },
                                {
                                    key: "getSearchSuggests",
                                    value: function (t) {
                                        var s = e.defer();
                                        return this.searchService.setLocation(this.currentCity.name),
                                            this.searchService.setComplete(function (e) {
                                                return s.resolve(e.detail.pois)
                                            }),
                                            this.searchService.search(t),
                                            s.promise
                                    }
                                },
                                {
                                    key: "setSearchResult",
                                    value: function (e) {
                                        return this.searchResults = e,
                                            e
                                    }
                                },
                                {
                                    key: "guessCity",
                                    value: function () {
                                        return l.city.get({
                                            type: "guess"
                                        }).$promise
                                    }
                                },
                                {
                                    key: "changeCity",
                                    value: function (e, t) {
                                        return this.currentCity = e,
                                        t.mapMode && this.map.setCenter(new qq.maps.LatLng(e.latitude, e.longitude)),
                                            e
                                    }
                                },
                                {
                                    key: "buildMarker",
                                    value: function (e, t, s) {
                                        var n = this;
                                        this.resultsShow = !0,
                                            this.infoWin.close();
                                        var r = new qq.maps.Marker({
                                            map: this.map,
                                            position: new (a.apply(qq.maps.LatLng, [null].concat(i(t)))),
                                            draggable: !1,
                                            visible: !0,
                                            icon: this._getMarkerIcon(e)
                                        });
                                        this.searchMarkers.push(r),
                                            qq.maps.event.addListener(r, "mouseover",
                                                function () {
                                                    r.setIcon(n._getMarkerIcon(e, "current")),
                                                        r.setZIndex(200),
                                                        s.mouseover()
                                                }),
                                            qq.maps.event.addListener(r, "mouseout",
                                                function () {
                                                    r.setIcon(n._getMarkerIcon(e)),
                                                        r.setZIndex(100),
                                                        s.mouseout()
                                                }),
                                            qq.maps.event.addListener(r, "click",
                                                function () {
                                                    p.$apply(function () {
                                                        n.chooseMarker(e)
                                                    })
                                                })
                                    }
                                },
                                {
                                    key: "clearMarkers",
                                    value: function () {
                                        this.searchMarkers.forEach(function (e) {
                                            return e.setVisible(!1)
                                        }),
                                            this.searchMarkers = [],
                                            this.infoWin.close()
                                    }
                                },
                                {
                                    key: "chooseMarker",
                                    value: function (e) {
                                        var t = this.searchMarkers[e],
                                            s = t.getPosition();
                                        this.showMarkerInfo(this.searchResults[e], s)
                                    }
                                },
                                {
                                    key: "focusMarker",
                                    value: function (e) {
                                        var t = this.searchMarkers[e];
                                        t.setIcon(this._getMarkerIcon(e, "current")),
                                            t.setZIndex(200)
                                    }
                                },
                                {
                                    key: "blurMarker",
                                    value: function (e) {
                                        var t = this.searchMarkers[e];
                                        t.setIcon(this._getMarkerIcon(e)),
                                            t.setZIndex(100)
                                    }
                                },
                                {
                                    key: "showMarkerInfo",
                                    value: function (e, t) {
                                        this._centerTo(t),
                                            "rank" === this.comfrom || "sakura" === this.comfrom ? e.url = this.redirect_url + "?latitude=" + e.latitude + "&longitude=" + e.longitude + "&name=" + e.name : e.url = "/place/" + e.geohash,
                                            p.infoWin = e,
                                            this.infoWin.open(),
                                            this.infoWin.setContent(u(c)(p)[0]);
                                        var s = this._fromLatLngToPoint(t);
                                        s.y = s.y - 35,
                                            this.infoWin.setPosition(this._fromPointToLatLng(s))
                                    }
                                },
                                {
                                    key: "_getMarkerIcon",
                                    value: function (e, t) {
                                        return new qq.maps.MarkerImage(this.MAP_SPRITES, new qq.maps.Size(24, 40), new qq.maps.Point(30 * e, "current" === t ? 40 : 0), new qq.maps.Point(12, 32))
                                    }
                                },
                                {
                                    key: "_showAreaInfo",
                                    value: function (e) {
                                        var t = this,
                                            s = new (a.apply(qq.maps.LatLng, [null].concat(i(e)))),
                                            n = o.encode.apply(o, i(e));
                                        this._centerTo(s),
                                            this.droppin.setPosition(s),
                                            l.poi.query({
                                                geohash: n,
                                                type: "geohash",
                                                "extras[]": "count"
                                            }).$promise.then(function (e) {
                                                t.showMarkerInfo(e[0], s)
                                            })
                                    }
                                },
                                {
                                    key: "_bindClickAreaEvent",
                                    value: function () {
                                        var e = this;
                                        qq.maps.event.addListener(this.map, "click",
                                            function (t) {
                                                var s = [t.latLng.lat, t.latLng.lng];
                                                e._showAreaInfo(s)
                                            })
                                    }
                                },
                                {
                                    key: "_centerTo",
                                    value: function (e) {
                                        var t = this._fromLatLngToPoint(e);
                                        t.y = t.y - this.INFOWIN_SIZE.getHeight() + this.SEARCHBAR_HEIGHT / 2,
                                        this.resultsShow && (t.x = t.x - this.RESULTBAR_WIDTH / 2),
                                            this.map.panTo(this._fromPointToLatLng(t))
                                    }
                                },
                                {
                                    key: "_fromLatLngToPoint",
                                    value: function (e) {
                                        var t = this.map.getProjection(),
                                            s = t.fromLatLngToPoint(this.map.getBounds().getNorthEast()),
                                            i = t.fromLatLngToPoint(this.map.getBounds().getSouthWest()),
                                            n = 1 << this.map.getZoom(),
                                            a = t.fromLatLngToPoint(e);
                                        return new qq.maps.Point((a.x - i.x) * n, (a.y - s.y) * n)
                                    }
                                },
                                {
                                    key: "_fromPointToLatLng",
                                    value: function (e) {
                                        var t = this.map.getProjection(),
                                            s = t.fromLatLngToPoint(this.map.getBounds().getNorthEast()),
                                            i = t.fromLatLngToPoint(this.map.getBounds().getSouthWest()),
                                            n = 1 << this.map.getZoom(),
                                            a = new qq.maps.Point(e.x / n + i.x, e.y / n + s.y);
                                        return t.fromPointToLatLng(a)
                                    }
                                }]),
                                t
                        }();
                    return new g
                }]
    },
    227: function (e, t) {
        e.exports = '<div class=mapinfowin><h3 class=mapinfowin-name ng-bind=infoWin.name></h3><p class=mapinfowin-address ng-bind=infoWin.address></p><div ng-if=infoWin.count><p class=mapinfowin-info>附近有 <span class=count ng-bind=infoWin.count></span> 家外卖商家</p><a class=mapinfowin-button ng-href={{infoWin.url}} ubt-click=1442>查看商家</a></div><div ng-if=!infoWin.count><p class=mapinfowin-info>附近没有外卖商家</p><a class="mapinfowin-button disabled">努力覆盖中</a></div></div>'
    },
    228: function (e, t) {
    },
    230: function (e, t, s) {
        e.exports = s.p + "media/img/map-sprites.3fa40c.png"
    },
    231: function (e, t, s) {
        "use strict";
        var i = s(232);
        s(234);
        var n = s(236);
        e.exports = function () {
            return {
                restrict: "A",
                templateUrl: i,
                replace: !0,
                controller: ["$scope",
                    function (e) {
                        e.avatar = e.user.avatar ? e.user.avatar : n
                    }]
            }
        }
    },
    232: function (e, t, s) {
        var i = "/entry/home/map/_block/map-header/map-header.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(i, '<div class="map-header clearfix"><h1><a href="/" ubt-click=1433><img src=' + s(233) + ' alt=eleme></a></h1><span class=map-header-right ng-if=user.user_id><a href=/profile target=_blank ubt-click=1440><img ng-src="{{avatar + \'|56x56\' | imgOptimize}}" alt={{user.username}}的头像> {{user.username}}</a> </span> <span class=map-header-right ng-if=!user.user_id><a ng-href="{{$root.ACCOUNTBASE + \'/register\'}}" target=_blank ubt-click=1430>注册</a> <span>|</span> <a ng-href="{{$root.ACCOUNTBASE + \'/login\'}}" ubt-click=1431>登录</a></span></div>')
            }]),
            e.exports = i
    },
    233: function (e, t, s) {
        e.exports = s.p + "media/img/map-logo.9a26ef.png"
    },
    234: function (e, t) {
    },
    236: function (e, t, s) {
        e.exports = s.p + "media/img/default-avatar.38e40d.png"
    },
    237: function (e, t, s) {
        "use strict";
        var i = s(238);
        s(240),
            e.exports = ["qqmap",
                function (e) {
                    return {
                        restrict: "A",
                        templateUrl: i,
                        replace: !0,
                        scope: {
                            mapMode: "="
                        },
                        link: function (t, s) {
                            t.mapMode = !1,
                                t.hideSearchResult = !1,
                                t.$watch("mapMode",
                                    function (t) {
                                        t && e.setup(s[0].querySelector(".map-content"))
                                    })
                        }
                    }
                }]
    },
    238: function (e, t, s) {
        var i = "/entry/home/map/_block/map-main/map-main.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(i, '<div class=map-main ng-class="{mapmode: mapMode}"><h2 class=map-logo><img src=' + s(239) + ' alt=eleme></h2><div class="map-navbar clearfix" ng-class="{hasuserinfo: $root.user.user_id}"><div map-city hide-search-result=hideSearchResult current-city=currentCity class=map-city map-mode=mapMode></div><div map-search hide-search-result=hideSearchResult current-city=currentCity map-mode=mapMode class=map-search></div></div><div class=map-content></div></div>')
            }]),
            e.exports = i
    },
    239: function (e, t, s) {
        e.exports = s.p + "media/img/map-logo-center.4eb348.png"
    },
    240: function (e, t) {
    },
    242: function (e, t, s) {
        "use strict";
        var i = s(243);
        s(244),
            e.exports = function () {
                return {
                    restrict: "A",
                    templateUrl: i,
                    replace: !0,
                    controller: function () {
                    }
                }
            }
    },
    243: function (e, t, s) {
        var i = "/entry/home/map/_block/map-footer/map-footer.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(i, "<div class=mapfooter><div class=mapfooter-app><div class=mapfooter-app-image><img src=" + s(112) + ' alt="扫码下载 APP"> <span>扫码下载 APP</span></div><div class=mapfooter-app-text><p>新用户首次下单</p><strong>最高</strong><strong class=color-stress>立减20元</strong><p>立即下载APP，享更多优惠吧！</p></div></div><p class=mapfooter-link> <a href=/support/about ubt-click=1435>联系我们</a> <a href=/support/about/agreement ubt-click=1436>服务条款和协议</a></p><div class="footer-copyright serif">增值电信业务许可证 : <a  target=_blank>沪B2-20150033</a> | <a #" target=_blank>沪ICP备 09007032</a> | <a  target=_blank>上海工商行政管理</a> Copyright ©2008-2016 ele.me, All Rights Reserved.</div><div class="footer-police container"><a  rel=nofollow target=_blank><img alt="已通过沪公网备案，备案号 310100103568" src=' + s(131) + " height=30></a></div></div>")
            }]),
            e.exports = i
    },
    244: function (e, t) {
    },
    246: function (e, t, s) {
        "use strict";
        function i(e, t) {
            if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
        }

        var n = function () {
                function e(e, t) {
                    for (var s = 0; s < t.length; s++) {
                        var i = t[s];
                        i.enumerable = i.enumerable || !1,
                            i.configurable = !0,
                        "value" in i && (i.writable = !0),
                            Object.defineProperty(e, i.key, i)
                    }
                }

                return function (t, s, i) {
                    return s && e(t.prototype, s),
                    i && e(t, i),
                        t
                }
            }(),
            a = s(31),
            r = s(247);
        s(248),
            e.exports = ["$rootScope", "$location", "Zero", "qqmap", "UBT", "Address",
                function (e, t, s, o, c, u) {
                    var h = function () {
                        function r(e) {
                            var s = this;
                            i(this, r),
                                this.suggests = [],
                                this.suggestLight = -1,
                                this.results = [],
                                this.resultLight = -1,
                                this.mapMode = e.mapMode,
                                this.keyMap = {
                                    37: "LEFT",
                                    38: "UP",
                                    39: "RIGHT",
                                    40: "DOWN",
                                    13: "ENTER",
                                    27: "ESC"
                                },
                                this.time = 0,
                                u.get({
                                    poi_type: "with_poi"
                                }).then(function (e) {
                                    return s.userAddress = e
                                }),
                                this.$scope = e,
                                this.comfrom = t.search().com_from,
                                this.redirect_url = t.search().redirect_url,
                                angular.$(document).on("click",
                                    function () {
                                        s.closeList(),
                                            e.$apply()
                                    })
                        }

                        return n(r, [{
                            key: "postUBT",
                            value: function (t) {
                                c.send("EVENT", {
                                    id: t.id,
                                    user_id: e.user.user_id,
                                    type: "EVENT",
                                    params: {
                                        map: t.map ? 1 : 0
                                    }
                                })
                            }
                        },
                            {
                                key: "changeCity",
                                value: function (e) {
                                    this.geohash = a.encode(e.latitude, e.longitude)
                                }
                            },
                            {
                                key: "openMapMode",
                                value: function () {
                                    var e = this;
                                    this.postUBT({
                                        id: 1429,
                                        map: this.mapMode
                                    }),
                                    this.mapMode && this.searchDetail(null, this.keyword),
                                        this.mapMode = !0,
                                        this.$scope.mapMode = !0,
                                        setTimeout(function () {
                                                e.searchDetail(null, e.keyword)
                                            },
                                            2e3)
                                }
                            },
                            {
                                key: "closeList",
                                value: function () {
                                    this.suggests = [],
                                        this.done = !1
                                }
                            },
                            {
                                key: "showSuggests",
                                value: function (e, t) {
                                    return e.stopPropagation(),
                                        t || "click" === e.type ? void(t && (this.keyMap[e.keyCode] || (this.keyword = t, (new Date).getTime() - this.time < 500 || (this.time = (new Date).getTime(), this.showSuggestsWithZero())))) : this.closeList()
                                }
                            },
                            {
                                key: "showSuggestsWithZero",
                                value: function () {
                                    var e = this;
                                    s.poi.query({
                                        version: "v2",
                                        type: "nearby",
                                        geohash: this.geohash,
                                        keyword: this.keyword,
                                        limit: 20,
                                        "extras[]": ["count"]
                                    }).$promise.then(function (t) {
                                        e.suggests = t,
                                            e.setMaxHeight(),
                                            e.done = !0,
                                        t.length || e.postUBT({
                                            id: 1444
                                        })
                                    })["catch"](function (e) {
                                        return Error(e)
                                    })
                                }
                            },
                            {
                                key: "chooseSuggest",
                                value: function (e) {
                                    e.stopPropagation();
                                    var t = 999,
                                        s = this.keyMap[e.keyCode];
                                    if (!s) return void(this.suggestLight = -1);
                                    if ("ESC" === s) return this.suggestLight = t,
                                        this.closeList();
                                    if (this.suggests && this.suggests.length) {
                                        if ("DOWN" === s && this.suggestLight++, "UP" === s && this.suggestLight--, "ENTER" === s && -1 === this.suggestLight) return this.openMapMode();
                                        this.suggestLight < 0 && (this.suggestLight = this.suggests.length - 1),
                                        this.suggestLight > this.suggests.length - 1 && (this.suggestLight = 0);
                                        var i = this.suggests[this.suggestLight],
                                            n = i.name;
                                        if ("ENTER" === s) return e.preventDefault(),
                                            void this.chooseAction(i);
                                        var a = this.container.querySelectorAll("li")[this.suggestLight],
                                            r = a.offsetTop,
                                            o = a.offsetHeight,
                                            c = r + o;
                                        c >= this.container.offsetHeight && (this.container.scrollTop = c - this.container.offsetHeight),
                                        this.container.scrollTop > r && (this.container.scrollTop = 0),
                                        n && (this.keyword = n)
                                    }
                                }
                            },
                            {
                                key: "chooseAction",
                                value: function (e) {
                                    this.postUBT({
                                        id: 1443,
                                        map: this.mapMode
                                    }),
                                        "rank" === this.comfrom || "sakura" === this.comfrom ? location.href = this.redirect_url + "?latitude=" + e.latitude + "&longitude=" + e.longitude + "&name=" + e.name : location.href = "/place/" + e.geohash
                                }
                            },
                            {
                                key: "maxHeight",
                                value: function () {
                                    var e = document.documentElement.clientHeight - this.container.getBoundingClientRect().top - 10 + "px";
                                    this.container.style.maxHeight = parseInt(e) > 500 ? "500px" : e
                                }
                            },
                            {
                                key: "setMaxHeight",
                                value: function () {
                                    var e = this;
                                    this.$scope.$$postDigest(function () {
                                        e.suggests.length ? (e.container = document.querySelector(".mapsearch-suggestlist"), e.maxHeight(), angular.$(window).on("resize", e.maxHeight.bind(e)), angular.$(window).on("scroll", e.maxHeight.bind(e))) : (angular.$(window).off("resize", e.maxHeight.bind(e)), angular.$(window).off("scroll", e.maxHeight.bind(e)))
                                    })
                                }
                            },
                            {
                                key: "searchDetail",
                                value: function (e, t) {
                                    var i = this;
                                    if (e && e.stopPropagation(), o.inited && t) {
                                        if (!this.mapMode) return this.showSuggests(e, t);
                                        this.closeList(),
                                            this.keyword = t,
                                            angular.$(o.el).addClass("sidebaropen"),
                                            this.resultshow = !0,
                                            this.$scope.hideSearchResult = !1,
                                            this.loading = !0,
                                            s.poi.query({
                                                keyword: t,
                                                type: "nearby",
                                                geohash: this.geohash,
                                                city_id: o.currentCity.id,
                                                "extras[]": "count",
                                                version: "v2"
                                            }).$promise.then(function (e) {
                                                return i.loading = !1,
                                                    i.results = e,
                                                    o.clearMarkers(),
                                                    e.length ? (e.forEach(function (e, t) {
                                                        o.buildMarker(t, [e.latitude, e.longitude], {
                                                            mouseover: function () {
                                                                return i.$scope.$apply(function () {
                                                                    return i.resultLight = t
                                                                })
                                                            },
                                                            mouseout: function () {
                                                                return i.$scope.$apply(function () {
                                                                    return i.resultLight = -1
                                                                })
                                                            }
                                                        })
                                                    }), o.showMarkerInfo(e[0], o.searchMarkers[0].getPosition()), void o.setSearchResult(e)) : i.postUBT({
                                                        id: 1445
                                                    })
                                            })
                                    }
                                }
                            },
                            {
                                key: "chooseResult",
                                value: function (e) {
                                    this.resultLight = e,
                                        o.chooseMarker(e)
                                }
                            },
                            {
                                key: "focusResult",
                                value: function (e) {
                                    this.resultLightHover = e,
                                        o.focusMarker(e)
                                }
                            },
                            {
                                key: "blurResult",
                                value: function (e) {
                                    this.resultLightHover = -1,
                                        o.blurMarker(e)
                                }
                            }]),
                            r
                    }();
                    return {
                        templateUrl: r,
                        scope: {
                            hideSearchResult: "=",
                            mapMode: "=",
                            currentCity: "="
                        },
                        controller: ["$rootScope", "$scope", "Address",
                            function (e, t, s) {
                                t.user = e.user,
                                    t.Address = s,
                                    t.search = new h(t, s),
                                    t.$watch("currentCity",
                                        function (e) {
                                            "undefined" != typeof e && t.search.changeCity(e)
                                        })
                            }]
                    }
                }]
    },
    247: function (e, t) {
        var s = "/entry/home/map/_block/map-search/map-search.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(s, '<form class=mapsearch-inputbar ng-submit="search.showSuggests($event, search.keyword)"><input placeholder=请输入你的收货地址（写字楼，小区，街道或者学校） ng-model=search.keyword ng-keyup="search.showSuggests($event, search.keyword)" ng-keydown=search.chooseSuggest($event) ng-click=search.showSuggests($event) ng-focus="search.showSuggests($event, search.keyword)"> <button class=btn-stress type=submit>搜 索</button></form><div class="mapsearch-suggestlist ui-scrollbar-light"><ul ng-if=search.suggests.length ng-class="{mapmode: mapMode}"><li ng-repeat="suggest in search.suggests track by $index" ng-class="{suggestlight: search.suggestLight === $index}" ng-click=search.chooseAction(suggest) ng-mouseenter="search.suggestLight = $index"><p class=suggest-name ng-bind=suggest.name></p><p class=suggest-addr><span ng-bind=suggest.address></span> <span ng-if=suggest.count ng-bind="\' 附近有\' + suggest.count + \'家商家\'"></span></p></li></ul><ul ng-if="search.done && !search.suggests.length"><li><p class=suggest-name>很抱歉，未找到相关地址：</p><p class=suggest-addr>请检查地址拼写是否正确，或尝试只输入写字楼、小区或学校名试试</p></li></ul></div><div class=mapsearch-sidebar ng-if="search.resultshow && !hideSearchResult && mapMode"><p class=mapsearch-resultcount>共<span class=count ng-bind=search.results.length></span>个地址</p><div ng-if="!search.results.length && !search.loading" class=mapsearch-noresult><h4>很抱歉，未找到相关地址：</h4><p>1.请检查地址拼写是否正确，或尝试只输入写字楼、小区或学校名试试</p><p>2.您也可以点击地图选择您的收货地址</p></div><div loading content=搜索中... ng-show=search.loading type=normal></div><ul ng-hide=search.loading class="mapsearch-resultgroup ui-scrollbar-light"><li class=mapsearch-resultblock ng-repeat="result in search.results track by $index"><a href=javascript: ng-class="{current: search.resultLightHover === $index, active: search.resultLight === $index}" ng-click=search.chooseResult($index) ng-mouseenter=search.focusResult($index) ng-mouseleave=search.blurResult($index) ubt-click=1440><span mark="{{$index % 10 + 1}}"></span><h3 class=resultblock-name ng-bind=result.name></h3><p class=resultblock-address ng-bind=result.address></p><p class=resultblock-info>附近有<span class=count ng-bind=result.count></span>家商家</p></a></li></ul></div>')
            }]),
            e.exports = s
    },
    248: function (e, t) {
    },
    250: function (e, t, s) {
        "use strict";
        function i(e, t) {
            if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
        }

        var n = function () {
            function e(e, t) {
                for (var s = 0; s < t.length; s++) {
                    var i = t[s];
                    i.enumerable = i.enumerable || !1,
                        i.configurable = !0,
                    "value" in i && (i.writable = !0),
                        Object.defineProperty(e, i.key, i)
                }
            }

            return function (t, s, i) {
                return s && e(t.prototype, s),
                i && e(t, i),
                    t
            }
        }();
        s(251);
        var a = s(253);
        e.exports = ["$rootScope", "Zero", "qqmap", "UBT",
            function (e, t, s, r) {
                var o = function () {
                    function a(e) {
                        var t = this;
                        i(this, a),
                            this.$scope = e,
                            this.showCities = !1,
                            this.groups = {},
                            this.$listPromise = this.getCities(),
                            this.guess = {},
                            this.current = {},
                            this.queryCity = {},
                            this.suggests = [],
                            s.guessCityPromise.then(function (s) {
                                t.current = t.guess = s,
                                    e.currentCity = s
                            }),
                            this.queryText = "",
                            angular.$(document).on("click",
                                function () {
                                    t.showCities = !1
                                })
                    }

                    return n(a, [{
                        key: "postUBT",
                        value: function (t) {
                            r.send("EVENT", {
                                id: t.id,
                                user_id: e.user.user_id,
                                type: "EVENT",
                                params: {
                                    map: t.map ? 1 : 0
                                }
                            })
                        }
                    },
                        {
                            key: "getCities",
                            value: function () {
                                var e = this;
                                return t.city.get({
                                    type: "group"
                                }).$promise.then(function (t) {
                                    var s = [];
                                    return angular.forEach(t,
                                        function (e) {
                                            s = s.concat(e)
                                        }),
                                        e.suggests = s,
                                        e.groups = t,
                                        t
                                })
                            }
                        },
                        {
                            key: "changeCity",
                            value: function (e) {
                                this.postUBT({
                                    id: 1427,
                                    map: this.$scope.mapMode
                                }),
                                    this.toggle(),
                                    this.current = e,
                                    this.$scope.currentCity = e,
                                    s.changeCity(e, {
                                        mapMode: this.$scope.mapMode
                                    }),
                                    this.$scope.hideSearchResult = !0,
                                    angular.$(s.el).removeClass("sidebaropen")
                            }
                        },
                        {
                            key: "setMaxHeight",
                            value: function () {
                                var e = document.documentElement.clientHeight - this.container.getBoundingClientRect().top - 10 + "px";
                                this.container.style.maxHeight = parseInt(e) > 500 ? "500px" : e
                            }
                        },
                        {
                            key: "toggle",
                            value: function (e) {
                                var t = this;
                                e && e.stopPropagation(),
                                this.showCities || this.postUBT({
                                    id: 1427,
                                    map: this.$scope.mapMode
                                }),
                                    this.$listPromise.then(function () {
                                        t.showCities = !t.showCities,
                                            t.$scope.$$postDigest(function () {
                                                t.showCities ? (t.container = document.querySelector(".mapcity-container"), t.setMaxHeight(), angular.$(window).on("scroll", t.setMaxHeight.bind(t)), angular.$(window).on("resize", t.setMaxHeight.bind(t))) : (angular.$(window).on("scroll", t.setMaxHeight.bind(t)), angular.$(window).off("resize", t.setMaxHeight.bind(t)))
                                            })
                                    })
                            }
                        }]),
                        a
                }();
                return {
                    templateUrl: a,
                    scope: {
                        hideSearchResult: "=",
                        currentCity: "=",
                        mapMode: "="
                    },
                    controller: ["$scope",
                        function (e) {
                            e.mapCity = new o(e),
                                e.stopPropagation = function (e) {
                                    return e.stopPropagation()
                                }
                        }]
                }
            }]
    },
    251: function (e, t) {
    },
    253: function (e, t) {
        var s = "/entry/home/map/_block/map-city/map-city.html";
        window.angular.module("ng").run(["$templateCache",
            function (e) {
                e.put(s, '<a class=mapcity-current href=javascript: ng-bind=mapCity.current.name ng-click=mapCity.toggle($event)></a><div class=mapcity-dialog ng-if=mapCity.showCities ng-click=stopPropagation($event)><div class="mapcity-container ui-scrollbar-light"><div class=mapcity-header><div class=mapcity-breadcrumb><span class=highlight>选城市</span> > 定位置 > 叫外卖</div><h3>请选择你所在的城市</h3></div><div class=mapcity-guess><div class=mapcity-quickguess><span class=highlight>猜你在</span> <button type=button name=button ng-bind=mapCity.guess.name ng-click=mapCity.changeCity(mapCity.guess)></button></div><div class=mapcity-search><input name=name placeholder=请输入城市 ng-model=queryText ng-keydown=mapCity.chooseFromQuery($event)><ul class=mapcity-suggestlist ng-if="mapCity.suggests.length && queryText"><li ng-repeat="suggest in mapCity.suggests | filter:queryText | limitTo: 8" ng-click=mapCity.changeCity(suggest)><span class=pinyin ng-bind=suggest.pinyin></span> <span ng-bind=suggest.name></span></li><li ng-if="!mapCity.suggests.length && queryText">该城市未覆盖</li></ul></div></div><div class=mapcity-list ng-if=mapCity.groups.$resolved><dl ng-repeat="(key, group) in mapCity.groups track by key"><dt class=highlight ng-bind=key><dd ng-repeat="city in group"><a href=javascript: ng-bind=city.name ng-click=mapCity.changeCity(city)></a></dl></div></div></div>')
            }]),
            e.exports = s
    }
});
